export default {
    inserted (el, binding) {
        const { value, arg } = binding
        let allowList = ['DRAFT', 'REJECTED']
        if(arg) {
            allowList = allowList.concat(arg.split(','))
        }
        if(!allowList.includes(value)) {
            el.style.display = 'none'
        }
    },
    /***
     * 当数据更新时，需要显示出按钮，因此采用css样式隐藏的方式，同时在update钩子内，进行样式替换
     */
    componentUpdated (el, binding) {
        const { value, arg } = binding
        let allowList = ['DRAFT', 'REJECTED']
        if(arg) {
            allowList = allowList.concat(arg.split(','))
        }
        if(allowList.includes(value)) {
            el.style.display = 'inline-block'
        }
    }
}
